package admin;

import handler.UserHandler;

import java.awt.Dimension;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JPanel;

import entity.User;

public class WorkerAdmin extends JPanel implements ActionListener{
	
	DataPanel dataPanel;
	ButtonPanel buttonPanel;
	
	public WorkerAdmin(Dimension frameSize){
		super();
		dataPanel = new DataPanel(new String[]{"UID", "WID", "Firstname", "Lastname", "E-Mail","Password", "Phone", "PID", "GID"});
		buttonPanel = new ButtonPanel();
		
		this.setSize(600, 600);
		this.setLayout(null);
		dataPanel.setBounds(0, 20, frameSize.width, (frameSize.height-100));
		this.add(dataPanel);
		buttonPanel.setBounds(0, (frameSize.height-100), frameSize.width, 100);
		this.add(buttonPanel);
		
		buttonPanel.getLoad().addActionListener(this);
	}
	@Override
	public void actionPerformed(ActionEvent e) {
		
		//User user = new UserHandler().loadUser(new Integer(dataPanel.getData()[0]).intValue());
		//dataPanel.setData(new String[]{user.getUid()+"", user.getFirstname(), user.getLastname(), user.geteMail(), user.getPhone()});
	}

}
